/*
 * ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
 * Without permission, no one has the right to obtain, disclose or use this software in any way.
 */

package com.ecarx.systemui.plugin.ui.adapter.entity;

import androidx.annotation.Nullable;

import com.ecarx.module_bluetooth.aosp.CachedBluetoothDevice;

import java.util.Objects;

public abstract class ItemBluetooth {

    public abstract int getViewType();

    public CachedBluetoothDevice getData() {
        return null;
    }

    @Override
    public boolean equals(@Nullable Object obj) {
        if (!(obj instanceof ItemBluetooth)) {
            return false;
        }
        ItemBluetooth itemBluetooth = (ItemBluetooth) obj;
        return getViewType() == itemBluetooth.getViewType() && Objects.equals(itemBluetooth.getData(), getData());
    }

    @Override
    public String toString() {
        return "ItemBluetooth{ ViewType=" + getViewType() +
                ", btDevice=" + (getData() != null ? getData().toString() : "is null") +
                "}";
    }
}
